package edu.udlap.spring2008.is300.finalexam.app.mvc.model.database.filters;

import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilter;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilterDecorator;

/**
 *
 * @author Ruslán Ledesma Garza
 */
public class AppImageRecordFilterId extends ImageRecordFilterDecorator
{    
    public AppImageRecordFilterId(ImageRecordFilter imageRecordFilter,
            int id, boolean isNegated)
    {
        decoratedImageRecordFilter_ = imageRecordFilter;
        filterValue_ = new Integer(id);
        isNegated_ = isNegated;
    }

    @Override
    protected String getSqlConstraints_()
    {
        return "\"ID_IMAGE\" " + (isNegated_ ? "!" : "") +
                "= " + filterValue_;
    }
    
}
